/*
 * @Author: 悦者生存 1002783067@qq.com
 * @Date: 2023-11-04 17:22:58
 * @LastEditors: 悦者生存 1002783067@qq.com
 * @LastEditTime: 2023-11-05 10:51:18
 * @FilePath: /client/src/pages/index.tsx
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import { useEffect, useState } from 'react';
import { connect } from 'umi';

interface Props {
  dispatch: (params: any) => Promise<any>;
}

function HomePage(props: Props) {
  const [users, setUsers] = useState([]);
  const { dispatch } = props;

  const getUserList = async () => {
    const users = await dispatch({ type: 'user/getUsers' });
    console.log(users);
  };

  useEffect(() => {
    getUserList();
  }, []);

  return <div>1111</div>;
}

export default connect()(HomePage);
